# Seymore - Content Management on Rails
# 
# Copyright (c) 2006 - 2007 Thomas Mango
# 
# For license information, please visit:
# http://code.google.com/p/seymore/
# 
# File created by Thomas Mango [tsmango@gmail.com]

module PageHelper
  def cancel_button(page)
    html = "<input type=\"button\" value=\"Cancel\" onclick=\"javascript: window.location = '/page/"
    if page.id != nil
      html += "show/#{page.slug}"
    elsif page.parent_id
      html += "show/#{Page.find(page.parent_id).slug}"
    end
    html += "';\"/>"
  end
end